package com.skytech.tax.customsdatawarehouse.singlewindow.taxhandle.domain.entity;

import com.alibaba.fastjson.JSONObject;
import org.joda.time.DateTime;

/**
 * @author Lianhong
 * @since 2022/4/15
 */
public class TaxBill {

    private String taxHeadSeqNo;  //税费单编号
    private String swTaxId;  //税费单ID
    private String entryId;  //报关单编号
    private String taxvouNo;  //税费单号
    private String taxBill;  //税费单信息
    private String socialCreditCode;  //组织机构代码
    private String payType;  //支付类型：0-未支付 1-已支付 2-支付中
    private String genDateStr;  //税单生成时间
    private String storageTime; //入库时间

    public TaxBill() {
    }

    public TaxBill(String socialCreditCode, String payType, JSONObject taxBill) {
        this.payType = payType;
        this.taxHeadSeqNo = taxBill.getString("taxHeadSeqNo");
        this.swTaxId = taxBill.getString("swTaxId");
        this.entryId = taxBill.getString("entryId");
        this.taxvouNo = taxBill.getString("taxvouNo");
        this.taxBill = taxBill.toJSONString();
        this.genDateStr = taxBill.getString("genDateStr");
        this.socialCreditCode = socialCreditCode;
        this.storageTime = DateTime.now().toString("yyyy-MM-dd HH:mm:ss");
    }

    public String getSwTaxId() {
        return swTaxId;
    }

    public void setSwTaxId(String swTaxId) {
        this.swTaxId = swTaxId;
    }

    public String getTaxHeadSeqNo() {
        return taxHeadSeqNo;
    }

    public void setTaxHeadSeqNo(String taxHeadSeqNo) {
        this.taxHeadSeqNo = taxHeadSeqNo;
    }

    public String getEntryId() {
        return entryId;
    }

    public void setEntryId(String entryId) {
        this.entryId = entryId;
    }

    public String getTaxvouNo() {
        return taxvouNo;
    }

    public void setTaxvouNo(String taxvouNo) {
        this.taxvouNo = taxvouNo;
    }

    public String getTaxBill() {
        return taxBill;
    }

    public void setTaxBill(String taxBill) {
        this.taxBill = taxBill;
    }

    public String getSocialCreditCode() {
        return socialCreditCode;
    }

    public void setSocialCreditCode(String socialCreditCode) {
        this.socialCreditCode = socialCreditCode;
    }

    public String getPayType() {
        return payType;
    }

    public void setPayType(String payType) {
        this.payType = payType;
    }

    public String getGenDateStr() {
        return genDateStr;
    }

    public void setGenDateStr(String genDateStr) {
        this.genDateStr = genDateStr;
    }

    public String getStorageTime() {
        return storageTime;
    }

    public void setStorageTime(String storageTime) {
        this.storageTime = storageTime;
    }

    public TaxBillSimple buildSimple() {
        return new TaxBillSimple(this.taxHeadSeqNo);
    }
}
